<% @main_header = "#{link_to('Ptrack:', '/')} #{@project.name} : #{@task.name}" %>
<div class='column span-24'>
  <h4><b> <%= @task.name %> Overview</b></h4>

  <div class='span-8'>
    <ul>
      <li>Description: <%= @task.description %></li>
      <li>Start Date: <%= @task.created_at.strftime('%d %b %Y') %></li>
      <li>End Date: -</li>
      <li>Estimated Duration: <%= @task.projected_time %></li>
      <li>Total Working Hours: <%= over_estimate(@task.projected_time,@total_working_hours) %></li>
    </ul>
  </div>

  <div class='span-16 last'>
    <h4><b>Input new working hour:</b></h4>
    <%= "<div class='error' style='width:60%;'>You should provide a valid(numerical) amount less than 24 hours !</div>" if params[:error] == 'num' %>

    <% form_for :work_unit,@work_unit, :url => {:action => 'update_work', :id => @work_unit, :project_id => @project, :activity_id => @activity} do |f| %>
      <%= select("user","id", @people, {:selected => @work_unit[:user_id]}) %>
      <%= f.label 'Worked for' %>
      <%= f.text_field :amount, :size => '5' %> <b>hrs</b>
      on <%= f.text_field :worked_at , :size => 10, :value => @work_unit[:worked_at].strftime("%m/%d/%Y")  %>
      <%= hidden_field :work_unit, :task_id %>
      <%= submit_tag 'Update' %>

    <% end %>

  </div>

  <div id="daily_activity" class='span-16 border'>
    <h4><b>Daily Activity</b></h4>
    <ul>
      <% for activity in @activity_logs do %>
          <li> <%= activity.created_at.strftime('%d %b, %Y %H:%M') %><br /><%= activity.description %></li>
        <% end %>
      </ul>
    </div>

  </div>